package com.andy.blog.common.enums;

import lombok.Getter;

/**
 * Created by andy on 2023/8/2 12:31
 */
@Getter
public enum LikeTypeEnum {
    /**
     * 文章
     */
    ARTICLE("article", "文章", "articleBusService"),

    /**
     * 评论
     */
    COMMENT("comment", "评论", "commentReplyBusService");

    /**
     * 说说
     */
    //TALK("说说", "talkLikeStrategyImpl");


    /**
     * 业务类型
     */
    private final String businessType;
    /**
     * 业务美年广场
     */
    private final String businessName;
    /**
     * 执行
     */
    private final String executeType;


    LikeTypeEnum(String businessType, String businessName, String executeType) {
        this.businessType = businessType;
        this.businessName = businessName;
        this.executeType = executeType;
    }

    /**
     * 获取bean
     */
    public static String getExecuteTypeByBusiness(String likeType) {
        for (LikeTypeEnum typeEnum : values()) {
            if (typeEnum.getBusinessType().equals(likeType)) {
                return typeEnum.getExecuteType();
            }
        }
        return likeType;
    }
}
